home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / CLSGRPH.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  734 b   |  25 lines

  1. #include <graphics.h>
  2.  
  3. main()
  4. {
  5.    int errorcode;
  6.    int graphdriver = DETECT;
  7.    int graphmode;
  8.  
  9. /* Detect and initialize graphics system */
  10.    initgraph(&graphdriver, &graphmode, "c:\\turboc");
  11.    errorcode = graphresult();
  12.    if (errorcode != grOk)
  13.    {
  14.       printf("Graphics error: %s\n", grapherrormsg(errorcode));
  15.       exit(1);
  16.    };
  17.  
  18.    settextjustify(CENTER_TEXT, CENTER_TEXT);
  19.    settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 1);
  20.    outtextxy( getmaxx() / 2, getmaxy() / 2,
  21.    "Graphics programs need initgraph() and closegraph()");
  22.    outtextxy(getmaxx()/2, getmaxy() - 50, "Press any key to exit:");
  23.    getch();        /* Wait until a key is pressed */
  24.    closegraph();   /* Exit graphics library */
  25. }